Skip to content

Fix/user mask overwrite#63

Merged
rfievet merged 2 commits intomasterfrom
fix/user-mask-overwrite
Apr 7, 2026
Merged

Fix/user mask overwrite#63
rfievet merged 2 commits intomasterfrom
fix/user-mask-overwrite

Conversation

@aliFrancis
Copy link
Copy Markdown
Collaborator

Hotfix for issue I noticed during some testing. After annotating pixels, then training, the AI predictions would be incorrectly included in the user mask, and not only the final mask.

This PR fixes the problem by stopping the writing of those pixels to the newUserMaskData. In fact, newUserMaskData is not necessary at all in the legacyPredictMask() function, as predictions will never influence the user mask.

To reproduce error in code prior to hotfix:

(i) reset mask (remove all user and ai pixels)
(ii) draw pixels of 2 classes (observe the user mask correctly visualises the brushstrokes)
(iii)train AI model
(iv) observe user mask again, which will now be filled with all the AI's predictions, filling in the whole image around the user's annotations

Copilot AI review requested due to automatic review settings April 2, 2026 15:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a bug where AI-predicted pixels were being incorrectly marked as user-drawn pixels during legacyPredictMask(), causing the user mask view to be overwritten by predictions after training.

Changes:

  • Stops writing AI prediction pixels into the user mask data during prediction application.
  • Removes the unnecessary newUserMaskData copy and related post-update verification/logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rfievet rfievet merged commit cf47a6f into master Apr 7, 2026
16 checks passed
@rfievet rfievet deleted the fix/user-mask-overwrite branch April 7, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants